<template>
  <div>
<h2>登录页面</h2>
<table class="table table-bordered">
       
        <tr>
          <td align="right">联系方式</td>
          <td><input type="text" v-model="state.phone"/></td>
        </tr>
       
        <tr>
          <td align="right">密码</td>
          <td><input type="password" v-model="state.pwd"/></td>
        </tr>
        
       
        <tr>
          <td align="right"></td>
          <td>
              <input type="button" value="登录" @click="Add">
          </td>
        </tr>
      </table>
  </div>

  
</template>

<script setup lang="ts">
import { reactive,toRefs } from 'vue';
import axios from 'axios';
import {useRouter}from'vue-router'
 const router=useRouter()

 let data=reactive({
  state:{ 
    pwd:'',
   phone:''
    
  },
  
 })
 let {state}=toRefs(data)
 function Add()
 {
  let obj = {
    phone:state.value.phone,
    pwd:state.value.pwd
  }
  axios({
    url:'/api/Member/Login',
    method:'get',
    params:obj

  })
  .then(res=>{
    if(res.data.data!="")
  {
    alert("登录成功")
   
  }
  else{
    alert("登录失败")
  }
  })
  .catch(err=>{
    
  })
 }
</script>

<style scoped>

</style>